home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / Protocols.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  3.8 KB  |  120 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: Protocols.h,v $ $Revision: 1.10 $ $Date: 92/05/14 12:54:34 $ */
  6. /*
  7. *  (c) Copyright 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  8. #ifndef _XmProtocols_h
  9. #define _XmProtocols_h
  10.  
  11. #include <Xm/Xm.h>
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. /* should be in XmP.h */
  18.  
  19. #ifndef XmCR_WM_PROTOCOLS
  20. #define XmCR_WM_PROTOCOLS 666
  21. #endif /* XmCR_WM_PROTOCOLS */
  22.  
  23. /* define the XM_PROTOCOLS atom for use in  routines */
  24. #ifdef XA_WM_PROTOCOLS
  25. #define XM_WM_PROTOCOL_ATOM(shell) XA_WM_PROTOCOLS
  26. #else
  27. #define XM_WM_PROTOCOL_ATOM(shell) \
  28.     XmInternAtom(XtDisplay(shell),"WM_PROTOCOLS",FALSE)
  29. #endif /* XA_WM_PROTOCOLS */
  30.  
  31.  
  32. #define XmAddWMProtocols(shell, protocols, num_protocols) \
  33.       XmAddProtocols(shell, XM_WM_PROTOCOL_ATOM(shell), \
  34.              protocols, num_protocols)
  35.  
  36. #define XmRemoveWMProtocols(shell, protocols, num_protocols) \
  37.       XmRemoveProtocols(shell, XM_WM_PROTOCOL_ATOM(shell), \
  38.             protocols, num_protocols)
  39.  
  40. #define XmAddWMProtocolCallback(shell, protocol, callback, closure) \
  41.       XmAddProtocolCallback(shell, XM_WM_PROTOCOL_ATOM(shell), \
  42.                 protocol, callback, closure)
  43.  
  44. #define XmRemoveWMProtocolCallback(shell, protocol, callback, closure) \
  45.   XmRemoveProtocolCallback(shell, XM_WM_PROTOCOL_ATOM(shell), \
  46.                 protocol, callback, closure)
  47.  
  48. #define XmActivateWMProtocol(shell, protocol) \
  49.       XmActivateProtocol(shell, XM_WM_PROTOCOL_ATOM(shell), protocol)
  50.  
  51. #define XmDeactivateWMProtocol(shell, protocol) \
  52.       XmDeactivateProtocol(shell, XM_WM_PROTOCOL_ATOM(shell), protocol)
  53.  
  54. #define XmSetWMProtocolHooks(shell, protocol, pre_h, pre_c, post_h, post_c) \
  55.       XmSetProtocolHooks(shell, XM_WM_PROTOCOL_ATOM(shell), \
  56.              protocol, pre_h, pre_c, post_h, post_c)
  57.  
  58.  
  59. /********    Public Function Declarations    ********/
  60. #ifdef _NO_PROTO
  61.  
  62. extern void XmAddProtocols() ;
  63. extern void XmRemoveProtocols() ;
  64. extern void XmAddProtocolCallback() ;
  65. extern void XmRemoveProtocolCallback() ;
  66. extern void XmActivateProtocol() ;
  67. extern void XmDeactivateProtocol() ;
  68. extern void XmSetProtocolHooks() ;
  69.  
  70. #else
  71.  
  72. extern void XmAddProtocols( 
  73.                         Widget shell,
  74.                         Atom property,
  75.                         Atom *protocols,
  76.                         Cardinal num_protocols) ;
  77. extern void XmRemoveProtocols( 
  78.                         Widget shell,
  79.                         Atom property,
  80.                         Atom *protocols,
  81.                         Cardinal num_protocols) ;
  82. extern void XmAddProtocolCallback( 
  83.                         Widget shell,
  84.                         Atom property,
  85.                         Atom proto_atom,
  86.                         XtCallbackProc callback,
  87.                         XtPointer closure) ;
  88. extern void XmRemoveProtocolCallback( 
  89.                         Widget shell,
  90.                         Atom property,
  91.                         Atom proto_atom,
  92.                         XtCallbackProc callback,
  93.                         XtPointer closure) ;
  94. extern void XmActivateProtocol( 
  95.                         Widget shell,
  96.                         Atom property,
  97.                         Atom proto_atom) ;
  98. extern void XmDeactivateProtocol( 
  99.                         Widget shell,
  100.                         Atom property,
  101.                         Atom proto_atom) ;
  102. extern void XmSetProtocolHooks( 
  103.                         Widget shell,
  104.                         Atom property,
  105.                         Atom proto_atom,
  106.                         XtCallbackProc pre_hook,
  107.                         XtPointer pre_closure,
  108.                         XtCallbackProc post_hook,
  109.                         XtPointer post_closure) ;
  110.  
  111. #endif /* _NO_PROTO */
  112. /********    End Public Function Declarations    ********/
  113.  
  114.  
  115. #ifdef __cplusplus
  116. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  117. #endif
  118.  
  119. #endif /* _XmProtocols_h */
  120.